From d9f95c7d750a1d41f6aa70d61392ad2e5d88dff1 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Sat, 16 Jan 2016 14:30:09 -0800 Subject: [PATCH] Drop wildcard crates.io warning The crates.io change is going through, so we don't want this warning around after it lands. --- src/cargo/ops/cargo_package.rs | 30 ------------------- tests/test_cargo_package.rs | 53 ---------------------------------- 2 files changed, 83 deletions(-) diff --git a/src/cargo/ops/cargo_package.rs b/src/cargo/ops/cargo_package.rs index d7da95c74..06897c2a7 100644 --- a/src/cargo/ops/cargo_package.rs +++ b/src/cargo/ops/cargo_package.rs @@ -2,13 +2,11 @@ use std::io::prelude::*; use std::fs::{self, File}; use std::path::{self, Path, PathBuf}; -use semver::VersionReq; use tar::Archive; use flate2::{GzBuilder, Compression}; use flate2::read::GzDecoder; use core::{SourceId, Package, PackageId}; -use core::dependency::Kind; use sources::PathSource; use util::{self, CargoResult, human, internal, ChainError, Config}; use ops; @@ -26,8 +24,6 @@ pub fn package(manifest_path: &Path, try!(check_metadata(&pkg, config)); } - try!(check_dependencies(&pkg, config)); - if list { let root = pkg.root(); let mut list: Vec<_> = try!(src.list_files(&pkg)).iter().map(|file| { @@ -104,32 +100,6 @@ fn check_metadata(pkg: &Package, config: &Config) -> CargoResult<()> { Ok(()) } -// Warn about wildcard deps which will soon be prohibited on crates.io -#[allow(deprecated)] // connect => join in 1.3 -fn check_dependencies(pkg: &Package, config: &Config) -> CargoResult<()> { - let wildcard = VersionReq::parse("*").unwrap(); - - let mut wildcard_deps = vec![]; - for dep in pkg.dependencies() { - if dep.kind() != Kind::Development && dep.version_req() == &wildcard { - wildcard_deps.push(dep.name()); - } - } - - if !wildcard_deps.is_empty() { - let deps = wildcard_deps.connect(", "); - try!(config.shell().warn( - "warning: some dependencies have wildcard (\"*\") version constraints. \ - On January 22nd, 2016, crates.io will begin rejecting packages with \ - wildcard dependency constraints. See \ - http://doc.crates.io/crates-io.html#using-crates.io-based-crates \ - for information on version constraints.")); - try!(config.shell().warn( - &format!("dependencies for these crates have wildcard constraints: {}", deps))); - } - Ok(()) -} - fn tar(pkg: &Package, src: &PathSource, config: &Config, diff --git a/tests/test_cargo_package.rs b/tests/test_cargo_package.rs index 290e46354..f7ad7d150 100644 --- a/tests/test_cargo_package.rs +++ b/tests/test_cargo_package.rs @@ -141,59 +141,6 @@ http://doc.crates.io/manifest.html#package-metadata for more info.")); dir = p.url()))); }); -test!(wildcard_deps { - let p = project("foo") - .file("Cargo.toml", r#" - [project] - name = "foo" - version = "0.0.1" - authors = [] - license = "MIT" - description = "foo" - repository = "bar" - - [dependencies] - bar = "*" - - [build-dependencies] - baz = "*" - - [dev-dependencies] - buz = "*" - "#) - .file("src/main.rs", "fn main() {}"); - - Package::new("baz", "0.0.1").publish(); - Package::new("bar", "0.0.1").dep("baz", "0.0.1").publish(); - Package::new("buz", "0.0.1").dep("bar", "0.0.1").publish(); - - assert_that(p.cargo_process("package"), - execs().with_status(0).with_stdout(&format!("\ -{packaging} foo v0.0.1 ({dir}) -{verifying} foo v0.0.1 ({dir}) -{updating} registry `{reg}` -{downloading} [..] v0.0.1 (registry file://[..]) -{downloading} [..] v0.0.1 (registry file://[..]) -{downloading} [..] v0.0.1 (registry file://[..]) -{compiling} baz v0.0.1 (registry file://[..]) -{compiling} bar v0.0.1 (registry file://[..]) -{compiling} foo v0.0.1 ({dir}[..]) -", - packaging = PACKAGING, - verifying = VERIFYING, - updating = UPDATING, - downloading = DOWNLOADING, - compiling = COMPILING, - dir = p.url(), - reg = registry::registry())) - .with_stderr("\ -warning: some dependencies have wildcard (\"*\") version constraints. On January 22nd, 2016, \ -crates.io will begin rejecting packages with wildcard dependency constraints. See \ -http://doc.crates.io/crates-io.html#using-crates.io-based-crates for information on version \ -constraints. -dependencies for these crates have wildcard constraints: bar, baz")); -}); - test!(package_verbose { let root = paths::root().join("all"); let p = git::repo(&root) -- 2.30.2